import React from 'react';
import {Route, Switch, Redirect} from 'react-router-dom'

import Layout from './home/index'
import Home from './home/home'
import Login from './modules/login/index'
import UserList from './modules/user/list'
import ThesisList from './modules/thesis/list';
import Test from './modules/test'
import NoMatch from './home/noMatch'

export default (
  <Route path="/">
    <Switch>
      <Route exact path="/login" component={Login}/>
      <Layout>
        <Switch>
          <Redirect exact path="/" to="/home"/>
          <Route exact path="/home" component={Home}/>
          <Route path="/user">
            <Switch>
              <Route exact path="/user/list" component={UserList}/>
            </Switch>
          </Route>
          <Route path="/thesis" component={ThesisList}></Route>
          <Route exact path="/test1" component={Test}/>
          <Route path="*" component={NoMatch}/>
        </Switch>
      </Layout>
    </Switch>
  </Route>
);
